package tr.edu.ege.kipler.satisfiability.completion.rules.dl;

/**
 * 
 * @author İnanç Seylan
 * 
 */
public class MergePair {
	private String from = "";

	private String into = "";

	private static MergePair emptyPair = new MergePair();

	public MergePair() {

	}

	public MergePair(String from, String into) {
		setFrom(from);
		setInto(into);
	}

	public static MergePair emptyPair() {
		return emptyPair;
	}

	public String getFrom() {
		return from;
	}

	public void setFrom(String from) {
		this.from = from;
	}

	public String getInto() {
		return into;
	}

	public void setInto(String into) {
		this.into = into;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj != null && (obj.getClass().equals(this.getClass()))) {
			MergePair other = (MergePair) obj;
			boolean matchedOpsEqual = this.getFrom().equals(other.getFrom())
					&& this.getInto().equals(other.getInto());
			boolean unmatchedOpsEqual = this.getFrom().equals(other.getInto())
					&& this.getInto().equals(other.getFrom());
			return matchedOpsEqual || unmatchedOpsEqual;
		}
		return false;
	}

	/**
	 * @see tr.edu.ege.seagent.alcbi.syntax.description.Concept#hashCode()
	 */
	@Override
	public int hashCode() {
		return 17 * 37 + getFrom().hashCode() + getInto().hashCode();
	}

}
